﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;

namespace So_Tu_Phap
{
    public partial class StartupForm : DevComponents.DotNetBar.Metro.MetroForm
    {
        public StartupForm()
        {
            InitializeComponent();
            this.CenterToScreen();
        }

        private void buttonX1_Click(object sender, EventArgs e)
        {
            CMSUtils ctk = new CMSUtils();

            ctk = ctk.login(this.txt_tendangnhap.Text);
            if (ctk == null)
            {
                MessageBoxEx.Show("Tên đăng nhập hoặc mật khẩu không đúng !");
            }
            else
            {
                this.Hide();
                trangchu tc = new trangchu();
                tc.Show();
                Properties.Settings.Default.Username = this.txt_tendangnhap.Text;
                Properties.Settings.Default.PassWord = "123";
                Properties.Settings.Default.Save();
            }
        }

        private void StartupForm_Load(object sender, EventArgs e)
        {
            this.AcceptButton = buttonX1;
        }
    }
}